package com.cskaoyan.mall.bean.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVO {
    private int errno;
    private Object data;
    private String errmsg;

    public static ResultVO ok(Object data){
        return new ResultVO(0, data, "成功");
    }

    public static ResultVO ok(){
        return new ResultVO(0, null, "成功");
    }

    public static ResultVO error(int code){
        return new ResultVO(code, null, "");
    }

    public static ResultVO error(int code, String errmsg){
        return new ResultVO(code, null, errmsg);
    }
}
